import 'package:flutter/material.dart';
import 'package:flutter_aggregate/model/onlineOrder/constants.dart';

class OnlineHomeCategoryItem extends StatelessWidget {
  const OnlineHomeCategoryItem({
    Key? key, 
    required this.title, 
    this.isActive = false, 
    required this.press,
  }) : super(key: key);

  final String title;
  final bool isActive;
  final VoidCallback press;

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: press,
      child: Padding(
        padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
        child: Column(
          children: [
            Text(
              title,
              style: isActive ? const TextStyle(
                color: onlineOrderKTextColor,
                fontWeight: FontWeight.bold
              ) : const TextStyle(
                fontSize: 12
              ),
            ),
            if (isActive)
              Container(
                height: 3,
                width: 22,
                decoration: BoxDecoration(
                  color: onlineOrderKPrimaryColor,
                  borderRadius: BorderRadius.circular(10)
                ),
              )
          ],
        ),
      ),
    );
  }
}